<?php
/**
 * Created by PhpStorm.
 * User: 明哲
 * Date: 2016/5/6
 * Time: 10:19
 */
include('../../config.php');
session_start();
$pipeUserName=$_SESSION['pipe_username'];
$action=$_GET['action'];
switch ($action) {

    case 'loginOut':
        $loginOut=$_GET['loginOut']?$_GET['loginOut']:'';
        if ($loginOut == 1) {
            session_start();
            $_SESSION['pipe_username'] = '';
            $_SESSION['pipe_password'] = '';
            echo 1;
        }
        break;
    case 'changePass':
        $newPass=$_GET['newPass']?$_GET['newPass']:'';
        $rows=$mysql->query("update `pipe` set `pipe_pass`='{$newPass}' where `pipe_username`='{$pipeUserName}'");
        echo 1;
        break;
}